package com.xxxx.server.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xxxx.server.mapper.IvaccineMapper;
import com.xxxx.server.pojo.Inucleic;
import com.xxxx.server.mapper.InucleicMapper;
import com.xxxx.server.pojo.Ivaccine;
import com.xxxx.server.pojo.RespPageBean;
import com.xxxx.server.service.IInucleicService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 辅导员核酸登记登记表 服务实现类
 * </p>
 *
 * @author zhoubin
 * @since 2022-06-04
 */
@Service
public class InucleicServiceImpl extends ServiceImpl<InucleicMapper, Inucleic> implements IInucleicService {
    @Autowired
    private InucleicMapper inucleicMapper;

    @Override
    public RespPageBean getInucleicByPage(Integer currentPage, Integer size, Inucleic inucleic, String[] beginDateScope, int type, String collegeName, int collegeid) {
        //开启分页
        Page<Inucleic> page = new Page<>(currentPage,size);
        IPage<Inucleic> inucleicByPage = inucleicMapper.getInucleicByPage(page, inucleic, beginDateScope,type,collegeName,collegeid);
        RespPageBean respPageBean = new RespPageBean(inucleicByPage.getTotal(), inucleicByPage.getRecords());
        return respPageBean;
    }

    @Override
    public List<Inucleic> getInucleicSeachList(Inucleic inucleic, String[] beginDateScope, int type, String collegename, int collegeid) {
        return inucleicMapper.getInucleicSeachList(inucleic, beginDateScope,type,collegename,collegeid);
    }


}
